package controller;

import helper.Configuration;

import java.util.Hashtable;

import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Displayable;

import view.Start;

public class Controller
{
	public static final int START = 1;
	private TrafficTip midlet;
	private Hashtable config;
	
	public Controller(TrafficTip midlet)
	{
		this.midlet = midlet;
		
		Configuration configuration = new Configuration();
		this.config = configuration.loadConfiguration();
	}
	
	public void action(int action)
	{
		Display display = this.midlet.getDisplay();
		Displayable displayable;
		
		switch (action)
		{
			default:
				displayable = new Start(this.config.get("applicationName").toString());
				((Start) displayable).build();
				display.setCurrent(displayable);
			break;
		}
	}
}
